from django.contrib import admin
from django.urls import path, include, re_path

from demo import views
from demo.views import *

urlpatterns = [
    # 使用语法规则<int:xx>
    # book会给info保存
    path('test/',views.test),
    # path("test/<int:info>/",views.test),
    # path("test/<slug:info>/",views.test),
    # path("test/<uuid:info>/",views.test),
    # path("test/<path:info>/",views.test),
    #?p就是规定参数，固定语法
    # <参数名> [限制路由只能由数字和abc组成] +一次及以上 123abc
    # () 把符合规则的内容保留下来传给info参数接受
    re_path('^re_test/(?P<info>[0-9abc]+)/$',views.re_test),
    re_path("^nav/(?P<classes>[a-zA-Z]+)/$",views.nav),
    path('405/',views.not_found,name='not_found'),
    path('index/',views.index,name='index'),
    path('classes/update/',views.update_classes,name='update'),
    path('classes/delete/',views.delete_classes,name='delete'),
    path('classes/func/',views.find_func,name='func'),
    path('classes/conditions/',views.find_conditions,name='conditions'),
    path('article/add/',AddArticleView.as_view(),name='AddArticle'),
    path('article/<int:id>/',ArticleDetail.as_view(),name='ArticleDetail'),
    path('article/user/',ArticleUser.as_view(),name='ArticleUser'),
    path('article/update/<int:id>',ArticleUpdate.as_view(),name='ArticleUpdate'),
    path('article/delete/<int:id>',ArticleDelete.as_view(),name='ArticleDelete'),


]